require "MetaWeblogClient"
require "json"

class WelcomeController < ApplicationController
  def index
    @title= "Minimalist Code---less is more!"
    @subtitle = "追求极简的代码艺术"
    server =  MetaWeblogClient.new("happybai","123bltmld","www.cnblogs.com","/happybai/services/metaweblog.aspx")
    ok,param = server.getUserBlogs()
    #ok, param = server.call2("blogger.getUsersBlogs","0","happybai","123bltmld")
    if ok then
      puts param.length
      @title =  param
      @subtitle = param[0]["blogName"]
    end
  end
end
